var tigerManageAd03 = {
	load : function () {
		Ext.QuickTips.init();
		this.createGrid(); //建立 Ext table
	},
  
	createGrid : function () {
	 	 var store = new Ext.data.JsonStore ({
	 	 	url:"/ad/sys/com/control/AdService.php?action=getAccountSettle&account="+getUser().Account,
			root : "row", 
			remoteSort: true,
			totalProperty: 'count',
			fields : ["createtime","adname","id","sumBudget","description"]
		});
		
		 
		var grid =new Ext.grid.GridPanel({
			renderTo : "grid",
			store :  store,
			height: 330,
			loadMask : true,
			viewConfig : {
				forceFit : true 
			},
			columns : [ 
				new Ext.grid.RowNumberer(),
				{header : "日期", dataIndex : "createtime" , width : 30, sortable : true},
				{header : "項目", dataIndex : "adname" , width : 30, sortable : true},
				{header : "活動 ID", dataIndex : "id" , width : 30, sortable : true},
				{header : "說明", dataIndex : "description" , width : 30, sortable : true},
				{header : "總額", dataIndex : "sumBudget" , width : 30, sortable : true} 
			],
			
			bbar : new Ext.PagingToolbar({
				pageSize :20,
				store : store,
				displayInfo : true,
				displayMsg : "顯示第 {0} 筆到 {1} 筆紀錄,共 {2} 筆紀錄",
				emptyMsg : "沒有紀錄" 
			})
		});	
		
		store.load({
			params:{
				start:0,
				limit:20
			}
		});    
	}
	 
};

Ext.onReady(function (){
	tigerManageAd03.load();
});